perm filename NS.ME[S,DOC]1 blob sn#104044 filedate 1974-05-30 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00020 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00004 00002	
C00007 00003	Contents                                                       Page 0
C00009 00004	News Service                                                   Page 1
C00013 00005	The News Service Program--NS                                   Page 2
C00017 00006	Keyword Expressions                                            Page 3
C00021 00007	Keyword Expressions                                            Page 4
C00026 00008	Dates                                                          Page 5
C00030 00009	Dates                                                          Page 6
C00034 00010	Command Lines and Switches                                     Page 7
C00039 00011	Command Lines and Switches                                     Page 8
C00044 00012	Display Commands                                               Page 9
C00048 00013	Display Commands                                              Page 10
C00052 00014	Display Commands                                              Page 11
C00057 00015	Output Files                                                  Page 12
C00061 00016	Command File Input                                            Page 13
C00065 00017	Headline Stories                                              Page 14
C00069 00018	Using NS                                                      Page 15
C00074 00019	Comments on the Format of News Service Stories                Page 16
C00075 00020	
C00076 ENDMK
CāŠ—;



STANFORD ARTIFICIAL INTELLIGENCE LABORATORY               26 May 1974
OPERATING NOTE 72.1









                    READING THE WIRE SERVICE NEWS


                           By Martin Frost






ABSTRACT:

News from  a wire news  service (the Associated  Press) is  stored on
disk and can be read  selectively through the use of the  program NS.
To  read  the  news  using  this  program,  the  user  types  keyword
expressions  to specify  the stories  of interest  and  gives display
commands to have particular stories presented.  The News Service (NS)
system features the following:  treatment of all but the  most common
words as keywords; storage of  the news for a certain number  of days
(the user  can specify  which days'  news he  wants to  examine); and
display news presentation for users of Stanford displays.

Another program,  HOT, types  out the news  as it  comes in  over the
wire.





The Associated Press news report is made available in  these programs
for  demonstration and  research purposes  only and  caution  must be
exercised to insure  that the news is  not published or  broadcast or
publicly displayed or used for any commercial purpose.
Contents                                                       Page 0




                           C O N T E N T S


SECTION                                                          PAGE

The Wire Service News System  .  .  .  .  .  .  .  .  .  .  .  .  1
The Hot Line Program--HOT  .  .  .  .  .  .  .  .  .  .  .  .  .  1
The News Service Program--NS  .  .  .  .  .  .  .  .  .  .  .  .  1
Keyword Expressions  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  2
Dates .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  4
Command Lines and Switches .  .  .  .  .  .  .  .  .  .  .  .  .  6
Display Commands  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  8
Output Files   .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  12
Command File Input   .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  12
Headline Stories  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  14
Using NS .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  14
Comments on the Format of News Service Stories  .  .  .  .  .  .  15
News Service                                                   Page 1



                    The Wire Service News System


We have a line from  a wire news service (the Associated  Press) over
which we get  national and international  news (no local  news).  The
line is read by a program that takes incoming news stories  and files
them away on the disk.  As each story is filed, it is  categorized by
the words  occurring in  it.  To retrieve  selected stories  the user
types  to  the  NS program  (described  below)  a  keyword expression
indicating  what  words  or  combinations  of  words  the  stories of
interest should (or should not) contain.

Individuals can  access the  news through two  programs, NS  and HOT.
This document  describes the  use of these  programs for  reading the
news.



                      The Hot Line Program--HOT


The system program HOT provides the user a hot line to the  news.  To
use this  hot line,  type  the  monitor  command:  HOT.   The program
should type  back "...new Associated  Press news..." followed  by the
last several lines  of news that have  come in.  Thereafter  HOT will
continue typing out the news as it comes in.

If  the  hot line  is  down (for  instance  for testing  of  the news
system), then HOT will tell  you so and then stop.  There  are times,
usually of only a few minutes duration, when no news is coming in; at
such times, HOT will of course type out nothing.



                    The News Service Program--NS


The system  program NS allows  quick access to  stored news  from any
given period of time.  This program is started by typing  the monitor
command:  NS.  The  user can  then select  stories from  the  news by
typing  in  a  keyword  expression  that  indicates  which  words  or
combinations of words  a story must contain  to be of  interest.  The
program will respond by telling  the user how many stories  match the
given  expression,  and following  that,  the user  can  give display
commands to have certain of those stories presented to him.
The News Service Program--NS                                   Page 2


As each story comes in over the AP wire, it is categorized by all the
words occurring in it except  for a small class of very  common words
(such  as "the",  "a", "and",  etc.).  When  a keyword  expression is
entered by the user, it is compared against the  categorization lists
to find all the stories  that fit the expression.  The  keywords used
in an expression can be any words (consisting of letters only) except
the few common words specifically excluded from  categorizations.  If
a common word is used  in an expression by mistake, the  program will
give a warning to that effect.

Presentation  of  news  to  users on  Stanford  displays  is  done by
displaying a screenful of text at a time.  News is presented on other
terminals by typing out a portion of a story at a time.

(In all expressions and commands typed to NS, no distinction  is made
between upper-case letters and lower-case letters.)



                         Keyword Expressions


To retrieve stories using NS, you type in a KEYWORD EXPRESSION, which
may be either a  single keyword or an expression  containing keywords
and the operators  +, -, and *.   Each keyword represents the  set of
all the stories  it occurs in.  And  the operators represent  the set
operations UNION (+), INTERSECTION (*), and SET DIFFERENCE (-), which
are performed on  the sets of  stories which the  keywords represent.
Thus, if you want all stories that mention both Nixon  and Watergate,
you  should  type  the  keyword  expression  "NIXON * WATERGATE"; the
expression  "NIXON + WATERGATE" represents  all stories  that mention
either  Nixon or  Watergate; and  "NIXON - WATERGATE"  represents all
stories  that mention  Nixon but  not Watergate.   The  precedence of
operators is the normal one:  * takes precedence over + and  -, which
have equal precedence.  Operators with equal precedence are evaluated
from  left  to right.   Parentheses  may be  used  freely  in keyword
expressions.
Keyword Expressions                                            Page 3



To clarify all this a little, here are a few examples:

       Keyword Expression                        Meaning

---------------------------------    --------------------------------

(NIXON-DEAN+FORD)*IMPEACH            All  stories  that  mention both
                                     IMPEACH and either (1) NIXON and
                                     not  DEAN   or  (2)   FORD  (and
                                     possibly DEAN).

DEAN-NIXON-FORD-IMPEACH              All  stories  that  mention DEAN
                                     but that mention none  of NIXON,
                                     FORD and IMPEACH.

SAN*FRANCISCO+LOS*ANGELES-WAR        All stories that  mention either
                                     both SAN  and FRANCISCO  but not
                                     WAR, or both LOS and ANGELES but
                                     not WAR.

To facilitate finding specific  stories, a special form  is permitted
to be used as a keyword in keyword expressions.  This form is used to
represent all those stories  that have certain news  service sequence
numbers.  (For an explanation of sequence numbers, see the section at
the end  of this writeup  on COMMENTS ON  THE FORMAT OF  NEWS SERVICE
STORIES.)  To represent all  stories with sequence numbers from  N to
M, use the form "#N:M".   This form may occur anywhere a  keyword may
occur in an expression.  The form "#N:N" represents all  stories with
sequence number N and may be abbreviated "#N".  Furthermore, the form
"#0:99999" represents  all stories and  may be abbreviated  just "#".
In the form "#N:M", if N>M then this form represents all stories with
sequence numbers greater than or equal to N or less than or  equal to
M.  Below are some examples of this special form in use.

                #2 + #202            All stories with either of these
                                     sequence numbers. (These are the
                                     usual  sequence  numbers  of the
                                     AP news digests.)
Keyword Expressions                                            Page 4



                #325:23              All stories with sequence number
                                     greater than or equal to 325  or
                                     less than or equal to 23.

                #                    All stories.  Useful if you want
                                     to peruse through the news.

                #321*BULLETIN        Stories with sequence number 321
                                     that contain the word BULLETIN.

When you type  a keyword expression, the  program makes up a  list of
all the stories  that fit the expression.   This list is  called your
CURRENT STORY LIST.  When you type the next keyword expression, a new
current  story list  is  generated (unless  no stories  fit  your new
expression)  and your  former  current story  list is  saved  as your
PREVIOUS STORY  LIST.  If  you want  to get  back the  previous story
list, use the  /EXCHAN switch (see the  section on COMMAND  LINES AND
SWITCHES)  which exchanges  your  current and  previous  story lists.
This  feature is  especially useful  if you  are examining  news from
several days: The program  only keeps one day's  categorization lists
in core at a time and thus must read in one large file for each day's
news  under  consideration  every  time  you  enter  a   new  keyword
expression.  Retrieving your previous story list is thus  much faster
than reconstructing it through a keyword expression,  especially when
news from several days is being considered.

Your  current story  list can  be modified  without typing  again the
keywords you used to get it.  If a keyword expression starts  with +,
-, or *, the missing (first) operand is taken to be the  last keyword
expression you typed.  For example,  if you have typed in  "NIXON" as
your last keyword expression, you can type in "*VIETNAM" as your next
expression and you will get only stories that mention both  NIXON and
VIETNAM.  NOTE: This feature (starting a keyword expression with +, -
or *) is not yet implemented.



                                Dates


When started up, NS expects to reference only the news that  has come
in today.  However,  by using the date  switches you can  select what
range of dates is to be considered in constructing a story  list from
a  keyword expression.   The  program keeps  in core  only  one day's
categorization lists.  If you are reading news from only one  day, NS
will  only once  have  to read  in  the file  containing  that date's
Dates                                                          Page 5


categorization lists.  But with two  or more days in the  date range,
one or more data files must  be read in each time you type  a keyword
expression.

The date range can be  set with the date switches  (explained later).
The  /FROM switch  sets the  beginning date  of this  range,  the /TO
switch sets  the ending date  of the range,  and the /ON  and /DURING
switches  set both  the beginning  and ending  dates.  Each  of these
switches requires a date to be typed after the switch.  This date can
take any of the following example forms:

               MEANING AS                   MEANING AS
DATE           BEGINNING DATE               ENDING DATE

TODAY          today                        today
TOMORROW       tomorrow, if any news yet    same
SUNDAY         last Sunday before today     same
MONDAY         last Monday before today     same
 ...
SATURDAY       last Saturday before today   same

24-MAY-74      24 May 1974                  same
74-MAY-24      24 May 1974                  same
MAY-24-74      24 May 1974                  same
MAY-24-1974    24 May 1974                  same
 ...
MAY-24         24 May of current year       same
24-MAY         24 May of current year       same
MAY-74         1 May 1974                   31 May 1974

MAY            1 May of current year        31 May of current year
24             24th day of current month    same
74             1 January 1974               31 December 1974
1974           1 January 1974               31 December 1974

No spaces are allowed  in the middle of  a date.  Dashes are  used to
connect parts of a  date (month, day and  year), which can be  in any
order.  Names of  months and days of  the week and the  words "TODAY"
and  "TOMORROW"  may be  abbreviated  to three  letters  (or  less if
unambiguous).

Here are some date switches  with dates and their effect on  the date
range.

/ON TODAY           Date range becomes today only.
/DURING MAY         Date range runs from  1 May to 31 May  of current
                    year.
/DURING 74          Date range runs from 1 Jan 1974 to 31 Dec 1974.
Dates                                                          Page 6


/FROM TUES/TO TOD   (This  is two  switches in  same  command.)  Date
                    range is from last  Tuesday (a week ago  if today
                    is a Tuesday) to today.
/ON WED             Date range is last Wednesday only.
/ON 24-MAY          Date range is 24 May of current year.
/ON TOMORROW        Date range is tomorrow only.  After about 9pm new
                    stories are filed under the following day's date,
                    and this  one way to  reference that  date.  This
                    date  range is  illegal if  it is  not  after 9pm
                    Pacific Time.



                     Command Lines and Switches


When NS is ready to accept  a keyword expression, it will type  out a
star (*)  and wait for  a command line  to be typed  by the  user.  A
command line can contain either a keyword expression or some switches
or both.  A switch is a  slash (/) followed by the name of  a switch,
possibly followed by an  argument for the switch.  Switches  are used
for  setting  the  dates  for  which  stories  are  to  be retrieved,
determining the modes in which stories will be presented,  and giving
special commands.  A  command switch may appear  only by itself  on a
command line.

Switches that  set modes  of presentation can  be set  temporarily or
permanently.  Any mode switches that FOLLOW a keyword expression on a
command  line are  interpreted as  temporary and  are in  effect only
during evaluation of  the current keyword expression--after  that the
permanent switch values take effect again.  Any switches that precede
a keyword  expression or  that occur  on a  command line  without any
keyword expression  are made  permanent.  To  disable a  mode switch,
type a slash (/) followed by a minus sign (-) followed by the name of
the switch, e.g., "/-DPY".

The  currently available  switches  are listed  and  explained below.
Switch  names  can be  abbreviated  to any  extent  that  leaves them
unambiguous.

TYPE      NAME    MEANING

Date Switches     Each of these switches  must be followed by  a date
                  argument.  The  argument format is  explained above
                  in the section on DATES.
          FROM    The  argument following  this switch  specifies the
                  beginning  date in  the  range of  dates  for which
                  stories are to be retrieved.
Command Lines and Switches                                     Page 7


          TO      The  argument following  this switch  specifies the
                  ending date in the range of dates for which stories
                  are to be retrieved.
          ON      The  argument following  this switch  specifies the
                  entire date range.  See the section on DATES.
          DURING  This switch is identical to the /ON switch.

Mode Switches     Each of these can occur either in a  positive sense
                  (without a minus sign) or in a negative sense (with
                  a  minus  sign).   A mode  switch  is  temporary in
                  effect   only  when   occurring  after   a  keyword
                  expression; other  occurrences are  permanent.  The
                  initial  modes in  effect  when NS  starts  up are:
                  /CHRONO /SHOW /DPY /-HEADLI
          CHRONO  Construct   story   lists  with   the   stories  in
                  chronological   order  (oldest   first).   /-CHRONO
                  causes  story lists  to be  constructed  in reverse
                  chronological order.
          SHOW    Each   time   a   keyword   expression   is  typed,
                  automatically  enter   display  level   (unless  no
                  stories match  expression).  When display  level is
                  entered, the beginning  of the first story  of your
                  current story list is automatically  presented.  In
                  /-SHOW mode,  when a  keyword expression  is typed,
                  the program merely types out the number  of stories
                  in  the  resultant story  list.   To  enter display
                  level at any time, type a blank command  line (just
                  CARRIAGE   RETURN).   The   display-level  commands
                  available  are described  in the  section  below on
                  DISPLAY COMMANDS.
          DPY     This switch is meaningful only when the  program is
                  running on a  Stanford display.  Such a  display in
                  /-DPY mode will be treated like a non-display.
          HEADLI  For each story  list constructed, a  headline story
                  is  added  at  the  beginning  of  the  list.  This
                  headline story will contain the first few  lines of
                  each story in the list.  The positive sense of this
                  switch takes an optional argument consisting  of an
                  equals sign (=) followed by a number specifying the
                  requested number of headline-story lines devoted to
                  each real story.   This number should be  between 1
                  and  8 inclusive.   If the  argument is  omitted or
                  impossible to  satisfy, a  suitable number  will be
                  chosen by  the program.  See  the section  below on
                  HEADLINE STORIES.

Command Switches  Each  of  these  may only  appear  by  itself  on a
                  command line.
Command Lines and Switches                                     Page 8


          INFILE  Take subsequent  command lines  from a  given file.
                  The input file can be specified by giving  its name
                  as  an argument  to  this switch.   If  no argument
                  appears,  the  file  OPTION.TXT  on   your  current
                  (ALIAS) disk area will be used.  See the section on
                  COMMAND FILE INPUT for the format of  command lines
                  in the input file.
          INPUT   Resume  taking  command lines  from  currently open
                  command  file.   The  switch  /-INPUT   causes  the
                  program to  resume reading  command lines  from the
                  user's   terminal.    (/-INPUT   is   usually  only
                  meaningful  when  read  from  a  command  file, and
                  /INPUT  is  only  meaningful  when  read  from  the
                  terminal.)
          EXIT    Exit to monitor level.  If you then decide  you did
                  not really want to exit, typing the monitor command
                  CONTINUE will get you back into NS correctly.
          HELP    Present some information on the use of NS.
          SWITCH  Type out the names of all the switches.
          MODES   Type out the current values of the mode switches.
          DATES   Type out the  current date range.  See  the section
                  on DATES.
          REVERS  Reverse  the  order  of  the  current   story  list
                  (changing  the  order   of  only  that   list  from
                  chronological  to  reverse  chronological  or  vice
                  versa).
          COUNT   Type out the number of stories in the current story
                  list.
          EXCHAN  Exchange the  current story  list and  the previous
                  story list.   Then type out  the number in  the new
                  current story list.
          UPDATE  When  next  referencing today's  news  get  a fresh
                  version   of   the   data   file   containing   the
                  categorization lists.  This permits you to retrieve
                  stories that have come  in since you started  up NS
                  (or since you last gave this command).  This is not
                  necessary if  your date  range includes  more dates
                  than just today.



                          Display Commands


Stories are  presented to  the user  when the  program is  at display
level.   Display  level  is  entered  automatically  after  a keyword
expression is typed  if the program is  in /SHOW mode.  The  user can
enter display level explicitly  by typing a blank command  line (just
Carriage Return).
Display Commands                                               Page 9


The amount of a story that NS presents at one time is called a FRAME.

        If you are running  NS from a Stanford  display, each
        frame is a screenful  of text (about 30 lines)  and a
        single story can  be made up  of from one  to several
        frames, only one of which can be displayed at a time.
        Consecutive  frames  of  a story  overlap  by  half a
        screenful.

        If  you  are  running  NS  from  some  other  kind of
        terminal, each story consists of exactly  two frames.
        The first frame contains the first five lines  of the
        story and the second frame contains the  remainder of
        the story.

When display level is entered (on either kind of terminal), the first
frame of  the first  story in  your current  story list  is presented
(displayed or typed out).  After NS has presented a frame of a story,
it will await a display command from you.  On Stanford  displays each
display  command  is  a  single  character,  perhaps  preceded  by  a
numerical  argument.   On other  terminals,  a display  command  is a
single  character,  perhaps  preceded by  a  numerical  argument, and
followed by a CARRIAGE RETURN.

Each story in your current story  list is actually made up of  one or
more news service stories which  have been linked together by  the NS
system.  Each one of the  news service stories is called one  PART of
the  story  from  your story  list.   Display  commands  are oriented
towards displaying  either another  frame of  the same  part, another
part  of  the  same  story  or  another  story  in  the   main  list.
Furthermore, for each display command that moves you forward a frame,
part or story,  there is a command  that moves you backward  a frame,
part or story.   Thus there are six  basic display commands,  each of
which can  be preceded with  a numerical  argument.  (NOTE: Arguments
are not yet implemented except for the story commands U and I.)

    U   Advance to the  next story in the  main story list.   If this
        command has a  numerical argument, advance that  many stories
        in the main list.

    I   Same as U but backup in main story list instead of advancing.

    - - -

    J   Advance to the  next part of  the current story.   If current
        part is the  last one, advance to  first part of  next story.
        If this command has  a numerical argument, advance  that many
Display Commands                                              Page 10


        parts in the current story,  but not beyond the last  part of
        this story.

    K   Same as J but backup one or more parts instead  of advancing.
        If current part is the first one, backup to the last  part of
        the previous  story.  With  an argument,  do not  backup past
        first part of current story.

    - - -

    M   Advance to the  next frame of  the current part.   If current
        frame is last  one, advance to first  frame of next  part (or
        next story if no more parts).  With an argument, advance that
        many frames  in current  part without  going beyond  the last
        frame of this part.

    ,   (comma) Same as  M but backup one  or more frames  instead of
        advancing.   If  current frame  is  first one  of  this part,
        backup to the last frame of the previous part (or  last frame
        of last part of previous story if current part is  first part
        of story).  With an argument, do not backup beyond  the first
        frame of the current part.

On non-displays, typing a blank line as a display command advances to
the next  frame exactly like  the M command  above.  On  displays, no
carriage return is used with display commands.

On displays, typing one of the above six display commands with either
of both of the CONTROL and META keys down is the same as  typing that
command with an argument of 99999.  This will advance (or  backup) to
the last (first) frame, part or story depending on the command.

In addition to the above commands, there are several  other commands,
including two which cause the program to leave display level.

    Q   Quit display level and return to command level.  NS will type
        out a  star (*) and  expect a command  line next  (unless you
        currently have an command file open and active, in which case
        NS will type an at-sign (@) and read a command line  from the
        input file).

    E   Exit to the monitor.  On displays this command  requires both
        of the CONTROL and META  keys and will return the  display to
        its normal  state.  (On  displays an  "E" typed  without both
        CONTROL  and META  will  be a  no-op.)  If  you  decide after
        exiting that you were not finished, type the  monitor command
        CONTINUE and you will be back to display level  exactly where
Display Commands                                              Page 11


        you were before you exited.  On displays, CONTROL-META-E will
        also exit and normalize  the display when typed as  a command
        line.

    ?   (question mark) This causes  the program to present  the user
        with  some  helpful  information  about  the  various display
        commands.

    V   This command is ignored  except on displays, where  it causes
        the screen to be redrawn.

    X   This command tells  NS to read  an extended command  from the
        terminal.  The extended commands are listed below and  may be
        abbreviated  as much  as desired  provided that  they  do not
        become  ambiguous.  Each  of these  commands should  be ended
        with  a  carriage  return.   Numerical  arguments   to  these
        commands must precede the "X".  On non-displays, the carriage
        return following the display command X is omitted and the "X"
        is  followed  by the  extended  command name  and  a carriage
        return, for instance,  "2 X HEADLI<cr>" (the spaces  shown in
        this example are optional).  On any terminal, if the extended
        command  name is  followed by  an activation  character other
        than carriage return, the extended command will be aborted.

        NAME    MEANING OF EXTENDED COMMAND

        HEADLI  Present the  headline story  for the  current story
                list,  creating that  headline story  if necessary.
                If there is  a numerical argument (which  should be
                between 1 and 8),  try to allocate that  many lines
                per story in  the headline story.  See  the section
                below on HEADLINE STORIES.

        DSTORY  Delete  the current  story from  the  current story
                list.  This is  particularly useful if  the current
                story is not really  of interest and you  are going
                to output  the current  story list  to a  file, the
                line  printer or  the XGP.   If there  is  only one
                story left in the current story list when  you give
                this  command, that  story is  not deleted  and the
                program leaves display level.

        DPART   Delete  the  current part  from  the  current story
                list.  This is like DSTORY except that it  does not
                delete other parts of the current story.  NOTE: The
                DPART extended command is not yet implemented.
Output Files                                                  Page 12



                            Output Files


The command switch /OUTPUT causes all the stories (and parts) in your
current story  list to  be output to  a given  file.  To  specify the
filename for such output,  follow the /OUTPUT switch with  a filename
argument (which can include  extension and PPN, if desired).   If you
do not include  a filename argument, the  file NS.NS on  your current
(ALIAS) disk area  will be used.  If  you give a filename  without an
extension, the extension ".NS" will be used.

If the output file already exists, then you will be asked whether you
want it replaced or extended with the new stories or whether you want
to abort the file output.  However, if you follow the output filename
with one of the switches "/REPLACE", "/EXTEND" and "/ABORT",  then if
the output file already  exists, the action specified by  that switch
will be taken without your being asked.

In  addition,  if  the  output filename  is  followed  by  the switch
"/SPOOL", then the  output file will be  spooled on the  line printer
when the output is done.  The switch "/XSPOOL" following the filename
will cause the output file to be spooled on the XGP.

Finally, the  command switches /SPOOL  and /XSPOOL are  available for
spooling the stories in  your current story list without  saving them
in a file.  For these switches,  the output is directed to a  file on
your real  (logged-in) disk  area with a  name like  $NEWS0.NS, which
will be spooled and deleted.

NOTE:  None  of  the  command  switches  explained  in  this  section
(/OUTPUT, /SPOOL and /XSPOOL) are currently implemented, but all will
be available soon.



                         Command File Input


The command switch /INFILE  causes NS to endeavor to  read subsequent
command lines  from a  command file.   The name  of the  command file
should follow  in /INFILE  switch.  If no  filename is  included, the
file OPTION.TXT on your current  (ALIAS) disk area will be  read.  If
no  extension  is specified  with  an input  filename,  the extension
".TXT" will be  used.  If no primary  name is specified,  the primary
name "OPTION" will be used.  In PPN specifications, if  no programmer
name is  given, that  of your current  ALIAS will  be used.   Thus to
Command File Input                                            Page 13


specify  the  OPTION.TXT file  from  a different  project  under your
current programmer name, type "[PRJ]", where PRJ is the  project name
of  the disk  area  you want.   Also,  the right  square  bracket (])
closing the PPN  is optional.  NS can  handle most (if not  all) text
file formats, including SOS and E/TV.

Now a word about how command files are interpreted.

The collection of command lines in a command file must be preceded by
"NS:" which  must be the  first thing on  a line.   Different command
lines within  the file should  be separated with  commas (,)  and the
last command  line followed  by a  semicolon (;).   Carriage returns,
linefeeds, formfeeds  (page marks),  spaces, tabs  and nulls  are all
discarded when  read from  a command line  in a  command file.   If a
blank command  line is  read from  a command  file, then  exactly one
command line  will be  read from  the terminal  before going  back to
reading from the command file.

Every command line  line read from a  command file will be  typed out
preceded by an at-sign (@) to indicate that it came from the file.

Here is a sample command file (OPTION.TXT):


LOGIN: WHO;
NS: AP*NEWS*DIGEST/-SHOW,  /OUTPUT DIGEST/REPLACE,  /-INPUT,
    /SHOW BULLETIN,,URGENT,(TRAIN+PLANE)*CRASH;

This file  contains seven  command lines.   The first  one ("AP*NEWS*
DIGEST/-SHOW") will  find some  stories but will  not present  any of
those stories.  The second command line will cause the  stories found
in the first  command to be output  to the file  DIGEST.NS, replacing
any old file of the  same name.  The third command  line ("/-INPUT/")
will cause NS to discontinue reading commands from the  command file.
Commands  will  be  read  from  the  terminal  until  the  user types
"/INPUT", which will cause NS to resume reading from the command file
where it left off.   Then "/SHOW BULLETIN" may display  some stories,
one command line  will be read from  the terminal, and  next "URGENT"
may display some  stories, after which "(TRAIN+PLANE)*CRASH"  will be
evaluated and may display some stories.
Headline Stories                                              Page 14



                          Headline Stories


Through  use of  either  the /HEADLI  switch or  the  XHEADLI display
command, a special headline story can be generated which will include
the first few lines  of each story in  your main story list.   Such a
headline story can allow you to choose which stories you want to read
in more detail.

The headline  story is created  in core by  reading in the  first few
lines of each  main story and combining  this text into  the headline
story.  The headline story is  not actually created until you  ask to
see  it.   To  create this  story  requires  NS to  do  about  5 disk
operations (as counted  in the wholine) per  real story in  the list.
Thus if there  are several hundred stories,  it will take  NS several
seconds to create this story.  However, once the story is created, it
is kept in core until you change story lists.  The headline  story is
inserted at the front of the story list and is referred to as story 0
in the list.

Text is packed  into the headline story  as tightly as  possible with
carriage returns, linefeeds, and redundant spaces omitted.  The first
line of each  entry in the headline  story begins with the  number of
the particular story within  your main story list.  This  is followed
by the story's sequence number and the day of the month the  story is
from.  Subsequent lines for the same story's entry are indented.  The
number of lines of headline  story devoted to each story in  the list
is always between 1 and 8 and is determined either by the user  in an
argument to the /HEADLI switch  or the XHEADLI display command  or by
the program  if such  an argument  is not  given or  is unreasonable.
When no argument  is given, NS tries  to fit the headline  story into
about 30 lines of text.  If there are more than about 30 stories, one
line  is allocated  to each,  and if  there are  more than  about 140
stories, only the first 140 are included in the headline story.  This
latter case is indicated by the headline story ending with "...".



                              Using NS


To start NS,  type the monitor command:  NS.  This command  starts NS
with some temporary privileges  that are needed by the  program.  Any
monitor command that attempts to change your core image or disk ALIAS
will  disable   these  privileges  and   prevent  NS   from  working.
Furthermore, to use NS you must be a local user at the AI Lab or have
Using NS                                                      Page 15


the local-user privilege.  This is a restriction we must  enforce "to
insure  that  the news  is  not published  or  broadcast  or publicly
displayed or used for any commercial purpose."

To indicate that it is waiting for a command line to be typed  in, NS
types out a  carriage return and a  star (*).  When at  display level
awaiting a display command from a Stanford display, NS will typeout a
space and a dot (.).  When awaiting a display command from  any other
terminal, NS  will type  out either a  short row  of dashes  (-'s), a
short row of stars (*'s) or a space and a dot.  The space and dot are
typed out if the last frame of story typed out was the first frame of
a part (that  is, if there  is more text  in the current  part).  The
space and dot will appear on  the end of the fifth line of  the part.
The dashes or stars are typed out if the last frame typed out was the
end of a part; dashes indicate  that there is at least one  more part
to the current story and stars indicate that there are no  more parts
to that story.



           Comments on the Format of News Service Stories


Each story  sent over  the wire by  the Associated  Press (AP)  has a
sequence number which comes at the beginning of the story and  a date
and time that come at the end.  After the sequence number,  we insert
the date and time (Pacific Time) we received the story.  The sequence
numbers start over every day,  with the first story that  comes after
about midnight Eastern Time getting number 001.  Some special stories
(advance stories) are given sequence numbers out of the normal order;
these stories have numbers greater than 400.  The time at the  end of
each story is the approximate  New York time when the story  was sent
over the wire.

Every twelve hours (at about noon and midnight Eastern Time) there is
a news digest that summarizes the stories that are known to be coming
in over  the next twelve  hours.  The digest  at midnight  is usually
story number 002  and is called  the PMs digest;  the one at  noon is
usually number 202  and is called the  AMs digest.  No PMs  digest is
sent  for Sunday.   Stories that  have been  mentioned in  the latest
digest bear the heading word "BJT" (for "budget").

There are many stories every day that are corrections or additions to
previous stories.   We try to  link up each  such follow-up  with the
original and treat the  resultant combination as one story.   We call
each of the  separately numbered news service  stories a PART  of the
total story.  Long stories are usually broken up into smaller stories
Comments on the Format of News Service Stories                Page 16


by the  Associated Press;  the partial stories  are called  TAKES and
each  gets  its  own sequence  number.   We  sometimes  link together
several takes just like additions and corrections.